package com.hliushi.datasource.utils;

import org.apache.commons.lang3.time.FastDateFormat;

/**
 * @ClassName TimeUtils
 * @Description 时间工具类
 * @Author hliushi
 * @Date 2021/6/30 22:36
 * @Version V1.0
 **/
public abstract class TimeUtils {


    public static String format(Long timestamp, String pattern) {
        return FastDateFormat.getInstance(pattern).format(timestamp);
    }


    public static void main(String[] args) {
        String formatDate = TimeUtils.format(System.currentTimeMillis(), "yyyy-MM-dd");
        System.out.println("formatDate = " + formatDate);
    }
}
